﻿using System.ComponentModel;
using System.Web.Profile;

namespace SpiderMaster.AspNet.TradingSystem
{
    /// <summary> Provides re-usable Common Data Class (ProfileGroup) for Standard Contact Details;
    /// See <see cref="IStandardContactDetails"/> for Implementaion Details.
    /// </summary>
    [ReganSchroder(4, 10, 1, 10, 2009)]
    public class StandardContactDetails : SpiderMasterProfileGroupBase, IStandardContactDetails
    {
        /// <summary> Used for Creating a new Instance. </summary>
        public StandardContactDetails() : base() { }

        /// <summary> Used for creating an Instance from the ASP.NET Server and should not be used in your code! </summary>
        /// <param name="GroupBase"></param>
        public StandardContactDetails(ProfileGroupBase GroupBase) : base(GroupBase) { }

        /// <summary> Gets or sets the flat appartment number. </summary>
        /// <value>The flat appartment number.</value>
        [DefaultValue(MemberManagement.DefaultValues.FlatAppartmentNumber)]
        public string FlatAppartmentNumber
        {
            get { return this.GetPropertyValue(ProfilePropertyKey.FlatAppartmentNumber).ToString(); }
            set { this.SetPropertyValue(ProfilePropertyKey.FlatAppartmentNumber, value); }
        }

        /// <summary> Gets or sets a value indicating whether [address verified]. </summary>
        /// <value><c>true</c> if [address verified]; otherwise, <c>false</c>.</value>
        [DefaultValue(MemberManagement.DefaultValues.AddressVerified)]
        public bool AddressVerified
        {
            get { return bool.Parse(this.GetPropertyValue(ProfilePropertyKey.AddressVerified).ToString()); }
            set { this.SetPropertyValue(ProfilePropertyKey.AddressVerified, value); }
        }

        /// <summary> Gets or sets the location id. </summary>
        /// <value>The location id.</value>
        [DefaultValue(MemberManagement.DefaultValues.LocationId)]
        public int LocationId
        {
            get { return int.Parse(this.GetPropertyValue(ProfilePropertyKey.LocationId).ToString()); }
            set { this.SetPropertyValue(ProfilePropertyKey.LocationId, value); }
        }

        /// <summary> Gets or sets the post code. </summary>
        /// <value>The post code.</value>
        [DefaultValue(MemberManagement.DefaultValues.PostCode)]
        public int PostCode
        {
            get { return int.Parse(this.GetPropertyValue(ProfilePropertyKey.PostCode).ToString()); }
            set { this.SetPropertyValue(ProfilePropertyKey.PostCode, value); }
        }

        /// <summary> Gets or sets the name of the street. </summary>
        /// <value>The name of the street.</value>
        [DefaultValue(MemberManagement.DefaultValues.StreetName)]
        public string StreetName
        {
            get { return this.GetPropertyValue(ProfilePropertyKey.StreetName).ToString(); }
            set { this.SetPropertyValue(ProfilePropertyKey.StreetName, value); }
        }

        /// <summary> Gets or sets the street number. </summary>
        /// <value>The street number.</value>
        [DefaultValue(MemberManagement.DefaultValues.StreetNumber)]
        public string StreetNumber
        {
            get { return this.GetPropertyValue(ProfilePropertyKey.StreetNumber).ToString(); }
            set { this.SetPropertyValue(ProfilePropertyKey.StreetNumber, value); }
        }

        /// <summary> Gets or sets the phone area code. </summary>
        /// <value>The phone area code.</value>
        [DefaultValue(MemberManagement.DefaultValues.PhoneAreaCode)]
        public string PhoneAreaCode
        {
            get { return this.GetPropertyValue(ProfilePropertyKey.PhoneAreaCode).ToString(); }
            set { this.SetPropertyValue(ProfilePropertyKey.PhoneAreaCode, value); }
        }

        /// <summary> Gets or sets the phone country code. </summary>
        /// <value>The phone country code.</value>
        [DefaultValue(MemberManagement.DefaultValues.PhoneCountryCode)]
        public string PhoneCountryCode
        {
            get { return this.GetPropertyValue(ProfilePropertyKey.PhoneCountryCode).ToString(); }
            set { this.SetPropertyValue(ProfilePropertyKey.PhoneCountryCode, value); }
        }

        /// <summary> Gets or sets the phone local number. </summary>
        /// <value>The phone local number.</value>
        [DefaultValue(MemberManagement.DefaultValues.PhoneLocalNumber)]
        public int PhoneLocalNumber
        {
            get { return int.Parse(this.GetPropertyValue(ProfilePropertyKey.PhoneLocalNumber).ToString()); }
            set { this.SetPropertyValue(ProfilePropertyKey.PhoneLocalNumber, value); }
        }
    }
}